package com.lecture.java8.geekbang.demo03.reconfiguration;

import java.awt.*;

/**
 * 重构图片上传阿里云
 * @author 72879
 */
public class AliyunImageStore implements ImageStore {

    private void createBucketIfNotExisting(String bucketName) {
        //创建bucket逻辑
    }

    private String generateAccessToken() {
        //根据accessKey 和 secretKey生成accessToke
        return "";
    }

    @Override
    public String uploadImage(String bucketName, Image image) {
        createBucketIfNotExisting(bucketName);
        String accessToken = generateAccessToken();
        //将图片上传到阿里云
        //返回图片地址
        return null;
    }

    @Override
    public Image download(String url) {
        String accessToken = generateAccessToken();
        //将图片从阿里云下载
        return null;
    }
}
